package com.ntv.persistent.user;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.ntv.domain.IUser;
import com.ntv.domain.User;

public class UserRowMapper implements RowMapper {

	public Object mapRow(ResultSet rs, int idx) throws SQLException {
		IUser user = new User();

		user.setAnswer(rs.getString("answer"));
		user.setCreatedBy(rs.getLong("created_by"));
		user.setDateOfCreation(rs.getDate("created_on"));
		user.setDateOfUpdate(rs.getDate("udated_on"));
		user.setDob(rs.getDate("dob"));
		user.setEmail(rs.getString("email"));
		user.setFname(rs.getString("fname"));
		user.setGender(rs.getString("gender"));
		user.setId(rs.getLong("id"));
		user.setLname(rs.getString("lname"));
		user.setPassword(rs.getString("password"));
		user.setQuestion(rs.getString("question"));
		user.setUpdatedBy(rs.getLong("updated_by"));
		return user;
	}

}
